package com.yonyou.cyxdms.sysAuth.service.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yonyou.cyx.framework.dao.base.SuperMapper;
import com.yonyou.cyxdms.sysAuth.service.entity.OrgPositionPO;
import com.yonyou.cyxdms.sysAuth.service.vo.orgposition.OrgPositionDepartVO;
import com.yonyou.cyxdms.sysAuth.service.vo.orgposition.OrgPositionPageVO;
import com.yonyou.cyxdms.sysAuth.service.vo.role.RoleVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 职位 Mapper 接口
 * </p>
 *
 * @author quankk
 * @since 2019-07-05
 */
public interface OrgPositionMapper extends SuperMapper<OrgPositionPO> {

    public List<OrgPositionPageVO> pageOrgPosition(Page<OrgPositionPageVO> page,@Param("params") Map<String,Object> queryCondition);
    /**
     * 根据职务id获取所挂角色
     *
     * @author dengqiang
     * @since 2019/7/11
     */
    public List<RoleVO> getOrgPositionRoleById(@Param("id")Long id);
    /**
     * 根据职务id获取所挂组织
     *
     * @author dengqiang
     * @since 2019/7/11
     */
    public List<OrgPositionDepartVO> getOrgPositionDepartById(@Param("id")Long id);
    /**
     * code查重
     *
     * @author dengqiang
     * @since 2019/7/11
     */
    List<Map<String,Object>> getPositionByCode(@Param("positionCode")String positionCode,@Param("dataSource")Integer dataSource, @Param("dataType")Integer dataType);

    /**
     *  name查重
     *
     * @author dengqiang
     * @since 2019/7/11
     */
    List<Map<String,Object>> getPositionByName(@Param("positionName")String positionName,@Param("dataSource")Integer dataSource, @Param("dataType")Integer dataType);

    List<Map<String,Object>> findRoleIdsByPositionId(@Param("id")Long id);

    List<OrgPositionPageVO> getorgPositionType(Page<OrgPositionPageVO> page, @Param("param") Map<String, Object> param);
}
